package com.jsnkj.basic.bean

import java.io.Serializable

class AdPostTypeBean : Serializable {

    /**
     * amount : 1000
     * adtype_id : 1
     * adtype_name : 短视频广告
     * admodel_id : 1
     * admodel_value : 1777628064277086255
     * reward_rate : 0.50
     * exchange_rate : 10000
     * real_money : 0.2
     * displayed_at :
     */
    var admodel_id: String? = null
    var admodel_value: String? = null
    var adtype_id: String? = null
    var adtype_name: String? = null
    var amount: String? = null
    var displayed_at: String? = null
    var ecpm: String? = null
    var exchange_rate: String? = null
    var real_money: String? = null
    var reward_rate: String? = null

    companion object {
        // 主构造函数
        fun getInstance(
            amount: String?,
            ecpm: String?,
            adtype_id: String?,
            adtype_name: String?,
            admodel_id: String?,
            admodel_value: String?,
            reward_rate: String?,
            exchange_rate: String?,
            real_money: String?,
            displayed_at: String?
        ): AdPostTypeBean {
            var bean = AdPostTypeBean()
            bean.amount = amount
            bean.ecpm = ecpm
            bean.adtype_id = adtype_id
            bean.adtype_name = adtype_name
            bean.admodel_id = admodel_id
            bean.admodel_value = admodel_value
            bean.reward_rate = reward_rate
            bean.exchange_rate = exchange_rate
            bean.real_money = real_money
            bean.displayed_at = displayed_at
            return bean
        }
    }


    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is AdPostTypeBean) return false

        return amount == other.amount &&
                ecpm == other.ecpm &&
                adtype_id == other.adtype_id &&
                adtype_name == other.adtype_name &&
                admodel_id == other.admodel_id &&
                admodel_value == other.admodel_value &&
                reward_rate == other.reward_rate &&
                exchange_rate == other.exchange_rate &&
                real_money == other.real_money &&
                displayed_at == other.displayed_at
    }

    override fun hashCode(): Int {
        var result = amount?.hashCode() ?: 0
        result = 31 * result + (adtype_id?.hashCode() ?: 0)
        result = 31 * result + (ecpm?.hashCode() ?: 0)
        result = 31 * result + (adtype_name?.hashCode() ?: 0)
        result = 31 * result + (admodel_id?.hashCode() ?: 0)
        result = 31 * result + (admodel_value?.hashCode() ?: 0)
        result = 31 * result + (reward_rate?.hashCode() ?: 0)
        result = 31 * result + (exchange_rate?.hashCode() ?: 0)
        result = 31 * result + (real_money?.hashCode() ?: 0)
        result = 31 * result + (displayed_at?.hashCode() ?: 0)
        return result
    }

    override fun toString(): String {
        return "AdPostTypeBean(amount=$amount, ecpm=$ecpm, adtype_id=$adtype_id, adtype_name=$adtype_name, admodel_id=$admodel_id, admodel_value=$admodel_value, reward_rate=$reward_rate, exchange_rate=$exchange_rate, real_money=$real_money, displayed_at=$displayed_at)"
    }


}


class AdPostTypeListBean : Serializable {

    var list: ArrayList<AdPostTypeBean> = ArrayList()

}